const filter = require('@/utils/filter.js');
// let weiAppid='wx10d9329f9276b891';//微信公众号id
let weiAppid='wx606f33c38576bd9e';//微信公众号id
import wechat from "@/utils/wechat.js"
export default {
	wxLogin(callback){
		if(wechat.isWechat()){// 判断是否微信页面跳转   snsapi_base 获取openId  snsapi_userinfo 获取用户信息
			if(filter.getUrlParam("code")==undefined||filter.getUrlParam("code")==null||filter.getUrlParam("code")==""){//判断是否包含code 参数
				// )
				let urls = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${weiAppid}&redirect_uri=${encodeURI('http://8815o5733g.goho.co/pages/login/login')}&response_type=code&scope=snsapi_userinfo&state=${parseInt(
				              Math.random(10) * 10000000
				            )}&connect_redirect`

				   location.href = urls
			}else{
				return callback;
				//callback();
			}
			
		}
	},
	
}
